Optimal. Leaf size=46 \[ a (A-i B) x-\frac {a (i A+B) \log (\cos (e+f x))}{f}+\frac {i a B \tan (e+f x)}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3606, 3556}
\begin {gather*} -\frac {a (B+i A) \log (\cos (e+f x))}{f}+a x (A-i B)+\frac {i a B \tan (e+f x)}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3606
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) \, dx &=a (A-i B) x+\frac {i a B \tan (e+f x)}{f}+(a (i A+B)) \int \tan (e+f x) \, dx\\ &=a (A-i B) x-\frac {a (i A+B) \log (\cos (e+f x))}{f}+\frac {i a B \tan (e+f x)}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 66, normalized size = 1.43 \begin {gather*} a A x-\frac {i a B \text {ArcTan}(\tan (e+f x))}{f}-\frac {i a A \log (\cos (e+f x))}{f}-\frac {a B \log (\cos (e+f x))}{f}+\frac {i a B \tan (e+f x)}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 50, normalized size = 1.09
method | result | size |
derivativedivides | \(\frac {a \left (i B \tan \left (f x +e \right )+\frac {\left (i A +B \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-i B +A \right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(50\) |
default | \(\frac {a \left (i B \tan \left (f x +e \right )+\frac {\left (i A +B \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-i B +A \right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(50\) |
norman | \(\left (-i a B +a A \right ) x +\frac {i a B \tan \left (f x +e \right )}{f}+\frac {\left (i a A +a B \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f}\) | \(52\) |
risch | \(\frac {2 i a B e}{f}-\frac {2 a A e}{f}-\frac {2 a B}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}-\frac {a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) B}{f}-\frac {i a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) A}{f}\) | \(78\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.56, size = 53, normalized size = 1.15 \begin {gather*} \frac {2 \, {\left (f x + e\right )} {\left (A - i \, B\right )} a - {\left (-i \, A - B\right )} a \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 2 i \, B a \tan \left (f x + e\right )}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.56, size = 67, normalized size = 1.46 \begin {gather*} -\frac {2 \, B a - {\left ({\left (-i \, A - B\right )} a e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-i \, A - B\right )} a\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.22, size = 53, normalized size = 1.15 \begin {gather*} - \frac {2 B a}{f e^{2 i e} e^{2 i f x} + f} - \frac {i a \left (A - i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 110 vs. \(2 (42) = 84\).
time = 0.49, size = 110, normalized size = 2.39 \begin {gather*} \frac {-i \, A a e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - B a e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - i \, A a \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - B a \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 \, B a}{f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.47, size = 38, normalized size = 0.83 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (B\,a+A\,a\,1{}\mathrm {i}\right )}{f}+\frac {B\,a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________